from includes import *
from random import *
from time import *
from Galaxy import *

def drawGalaxy(galaxy_, stars_, x_, y_, w_, h_):
	galSurface = pygame.Surface((w_, h_))
	horizSpace = w_/galaxy_.getWidth()
	vertSpace = h_/galaxy_.getHeight()
	starGraphic = pygame.image.load("data/images/orange1.png")
	scaledStarGraphic = pygame.transform.scale(starGraphic, (32, 32))
	font = pygame.font.Font("data/fonts/bitstream.ttf", 10)

	for star in stars_:
		if star.closest == None:
			pass
		else:
			pass
			pygame.draw.aaline(galSurface, (255,255,255), (star.getX()*horizSpace+16,star.getY()*vertSpace+16), (star.closest[0]*horizSpace+16, star.closest[1]*vertSpace+16))
		galSurface.blit(scaledStarGraphic, (star.getX()*horizSpace, star.getY()*vertSpace, 128, 128))
		textSurface = font.render(star.name, 1, (255,255,255))
		textWH = font.size(star.name)
		galSurface.blit(textSurface, (star.getX()*horizSpace, star.getY()*vertSpace+25, textWH[0], textWH[1]))
	return galSurface
